package com.ruoyi.web.ci;

public class ne11 {

    public static void main(String[] args) {
         int[] a={1,20,3,9,8,11,4};
         int temp;
        System.out.println("排序前：");
        for (int i:a) {
            System.out.print(i+"\t");
        }
         for (int i=0;i<a.length;i++){
             for (int j = 0; j <a.length-i-1 ; j++) {
                 if (a[j]> a [j+1]) {
                     temp = a[j];
                     a[j]=a[j+1];
                     a[j+1]=temp;
                 }
             }
         }
        System.out.println("\n");
        System.out.println("排序后：");
        for (int i:a) {
            System.out.print(i+"\t");
        }
        System.out.println("over");
    }
}
